import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';

import { AuthModule } from './modules/auth/auth.module';
import { UserModule } from './modules/user/user.module';
import { MotionModule } from './modules/motion/motion.module';
import { RecordModule } from './modules/record/record.module';
import { PlanModule } from './modules/plan/plan.module';

import { MongooseModule } from '@nestjs/mongoose';
import { ConfigModule } from '@nestjs/config';
import { OssModule } from './modules/oss/oss.module';

@Module({
  imports: [
    ConfigModule.forRoot({
      envFilePath: '.env',
      isGlobal: true,
    }),
    MongooseModule.forRoot(process.env.DATABASE_URL || 'mongodb://localhost:27017/nest-workout'),
    AuthModule,
    UserModule,
    MotionModule,
    RecordModule,
    PlanModule,
    OssModule
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
